package com.crm.common.ka.core.feign.admin.entity;

/**
 * 时间范围枚举
 * @author litianyi
 */
public enum TimeRangeEnum {

    ALL(0),
    TODAY(1),
    YESTERDAY(2),
    WEEK(3),
    LAST_WEEK(4),
    MONTH(5),
    LAST_MONTH(6),
    QUARTERLY(7),
    LAST_QUARTERLY(8),
    YEAR(9),
    LAST_YEAR(10);

    private Integer time;

    TimeRangeEnum(Integer time) {
        this.time = time;
    }

    public Integer getTime() {
        return time;
    }

    public void setTime(Integer time) {
        this.time = time;
    }

    public static TimeRangeEnum getEnum(Integer value) {
        for (TimeRangeEnum enums : TimeRangeEnum.values()) {
            if (enums.getTime().equals(value)) {
                return enums;
            }
        }
        return null;
    }
}
